
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>cypress 获取</title>
    <style>
        .hover-child{
            display: none;
        }

        .hover:hover .hover-child{
            display: block;
        }
    </style>
</head>
<body>
    <div>
        <!-- 文案匹配 -->
        <div class="txt-selector">12 </div>
        <div class="txt-selector">1</div>
        <div class="txt-selector">1</div>
        <div class="txt-selector">11</div>
    </div>

    <div class="hover">
        <div class="hover-child">悬浮</div>
        模拟鼠标悬浮
    </div>

    <ul class="list">
        <li class="item" onClick="alert(1);">1</li>
        <li class="item" onClick="alert(2);">2</li>
        <li class="item"  onClick="alert(3);">3</li>
        <li class="item"  onClick="alert(4);">4</li>
        <span>prev</span>
        <li class="item active"  onClick="alert(5);">5</li>
        <span>next</span>
        <li class="item"  onClick="alert(6);">6</li>
        <li class="item"  onClick="alert(7);">7</li>
        <li class="item"  onClick="alert(8);">8</li>
        <li class="item"  onClick="alert(9);">9</li>
        <li class="item"  onClick="alert(10);">10</li>
    </ul>      

    <span>额外的span</span>

    <input type="text">

    <button class="submit-btn" onClick="reqData()">发送请求按钮</button>
</body>
<script>
    const reqData = function(){
        const xhr = new XMLHttpRequest();

        xhr.open('GET', 'http://localhost:3000/mock-data.json');

        xhr.onreadystatechange = function() {
        if (xhr.readyState === 4 && xhr.status === 200) {
            const response = JSON.parse(xhr.responseText);
            console.log(response);
        }
        };

        xhr.send();
    }
</script>
</html>